#ifndef UTILS_H_INCLUDED
#define UTILS_H_INCLUDED

#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <syslog.h>

#define LOCKFIFE	"/tmp/sysinfod"


#define LOCKMODE	(S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)




extern void replaceFirst(char *str1,char *str2,char *str3);
extern void replace(char *str1,char *str2,char *str3);
extern void substring(char *dest,char *src,int start,int end);
extern char charAt(char *src,int index);
extern int indexOf(char *str1,char *str2);
extern int lastIndexOf(char *str1,char *str2);
extern void ltrim(char *str);
extern void rtrim(char *str);
extern void trim(char *str);
int lockfile(int fd);
int already_running(void);
#endif // UTILS_H_INCLUDED
